﻿namespace Berko
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Runtime.CompilerServices;
    using BerkoRules.Mappers;

    public class GeneradorExcel
    {
        private static object MiAplicacion;
        private static object MiHoja;
        private static object MiLibro;

        public static void Crear_Excel(string categoria, bool todas)
        {
            string pathName = @"C:\clientes.xls";
            if (FileSystem.Dir(pathName, FileAttribute.Normal) != "")
            {
                FileSystem.Kill(pathName);
            }
            MiAplicacion = RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Excel.Application", ""));
            MiLibro = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(NewLateBinding.LateGet(MiAplicacion, null, "Workbooks", new object[0], null, null, null), null, "Add", new object[0], null, null, null));
            MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[] { 1 }, null, null, null));
            object[] arguments = new object[] { pathName };
            bool[] copyBack = new bool[] { true };
            NewLateBinding.LateCall(MiLibro, null, "SaveAs", arguments, null, null, copyBack, true);
            if (copyBack[0])
            {
                pathName = (string) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(string));
            }
            NewLateBinding.LateCall(MiLibro, null, "Close", new object[0], null, null, null, true);
            NewLateBinding.LateCall(MiAplicacion, null, "Quit", new object[0], null, null, null, true);
            MiHoja = null;
            MiLibro = null;
            MiAplicacion = null;
            if (todas)
            {
                GenerarExcel_Personalizado_Solapado("A", 1, true);
                GenerarExcel_Personalizado_Solapado("B", 2, true);
                GenerarExcel_Personalizado_Solapado("C", 3, true);
                GenerarExcel_Personalizado_Solapado("D", 4, true);
            }
            else
            {
                switch (categoria)
                {
                    case "A":
                        GenerarExcel_Personalizado_Solapado(categoria, 1, false);
                        break;

                    case "B":
                        GenerarExcel_Personalizado_Solapado(categoria, 2, false);
                        break;

                    case "C":
                        GenerarExcel_Personalizado_Solapado(categoria, 3, false);
                        break;

                    case "D":
                        GenerarExcel_Personalizado_Solapado(categoria, 4, false);
                        break;
                }
            }
        }

        public static void GenerarExcel_Personalizado_Solapado(string categoria, short cateID, bool todas)
        {
            int num5 = 1;
            try
            {
                object obj2;
                int num7;
                object miHoja;
                int num8;
                int num9;
                object[] objArray5;
                bool[] flagArray2;
                object[] objArray6;
                object[] objArray7;
                object[] objArray8;
                bool[] flagArray3;
                object[] objArray9;
                string str = @"C:\clientes.xls";
                MiAplicacion = RuntimeHelpers.GetObjectValue(Interaction.CreateObject("Excel.Application", ""));
                object[] arguments = new object[] { str };
                bool[] copyBack = new bool[] { true };
                if (copyBack[0])
                {
                    str = (string) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(string));
                }
                MiLibro = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(NewLateBinding.LateGet(MiAplicacion, null, "Workbooks", new object[0], null, null, null), null, "Open", arguments, null, null, copyBack));
                if (todas)
                {
                    switch (categoria)
                    {
                        case "A":
                            MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[] { 1 }, null, null, null));
                            break;

                        case "B":
                            MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[] { 2 }, null, null, null));
                            break;

                        case "C":
                            MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[] { 3 }, null, null, null));
                            break;

                        case "D":
                            MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[0], null, null, null), null, "Add", new object[0], null, null, null));
                            break;
                    }
                }
                else
                {
                    MiHoja = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(MiLibro, null, "Worksheets", new object[] { 1 }, null, null, null));
                }
                NewLateBinding.LateSet(MiHoja, null, "Name", new object[] { categoria }, null, null);
                DataTable table = ClientesMapper.Instance().xls_Traer_Todos((byte) cateID);
                if (table != null)
                {
                    int num6 = table.Rows.Count - 1;
                    for (int i = 0; i <= num6; i++)
                    {
                        object[] objArray = new object[] { num5, 1 };
                        copyBack = new bool[] { true, false };
                        if (copyBack[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[0]), typeof(int));
                        }
                        NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", objArray, null, null, copyBack), null, "Value", new object[] { table.Rows[i][1].ToString() }, null, null, false, true);
                        object[] objArray4 = new object[2];
                        obj2 = MiHoja;
                        object[] objArray3 = new object[2];
                        objArray3[0] = num5;
                        num7 = 1;
                        objArray3[1] = num7;
                        arguments = objArray3;
                        copyBack = new bool[] { true, false };
                        if (copyBack[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(int));
                        }
                        objArray4[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", arguments, null, null, copyBack));
                        miHoja = MiHoja;
                        objArray = new object[2];
                        num8 = num5 + 1;
                        objArray[0] = num8;
                        num9 = 1;
                        objArray[1] = num9;
                        objArray4[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray, null, null, null));
                        objArray5 = objArray4;
                        flagArray2 = new bool[] { true, true };
                        if (flagArray2[0])
                        {
                            NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num5, num7, RuntimeHelpers.GetObjectValue(objArray5[0]) }, null, null, true, false);
                        }
                        if (flagArray2[1])
                        {
                            NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num8, num9, RuntimeHelpers.GetObjectValue(objArray5[1]) }, null, null, true, false);
                        }
                        NewLateBinding.LateCall(NewLateBinding.LateGet(MiHoja, null, "Range", objArray5, null, null, flagArray2), null, "Merge", new object[0], null, null, null, true);
                        DataTable table2 = ClientesMapper.Instance().xls_Traer_Direcciones(Conversions.ToInteger(table.Rows[i][0]));
                        DataTable table3 = ClientesMapper.Instance().xls_Traer_Dir_Fiscales(Conversions.ToInteger(table.Rows[i][0]));
                        DataTable table4 = ClientesMapper.Instance().xls_Traer_Personas(Conversions.ToInteger(table.Rows[i][0]));
                        if ((table2 != null) && (table2.Rows.Count > 0))
                        {
                            objArray6 = new object[] { num5, 2 };
                            flagArray2 = new bool[] { true, false };
                            if (flagArray2[0])
                            {
                                num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray6[0]), typeof(int));
                            }
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", objArray6, null, null, flagArray2), null, "Value", new object[] { table2.Rows[0][0].ToString() }, null, null, false, true);
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 2, 3 }, null, null, null), null, "Value", new object[] { table2.Rows[0][1].ToString() }, null, null, false, true);
                        }
                        objArray4 = new object[2];
                        miHoja = MiHoja;
                        objArray7 = new object[2];
                        objArray7[0] = num5;
                        num9 = 2;
                        objArray7[1] = num9;
                        objArray6 = objArray7;
                        flagArray2 = new bool[] { true, false };
                        if (flagArray2[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray6[0]), typeof(int));
                        }
                        objArray4[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray6, null, null, flagArray2));
                        obj2 = MiHoja;
                        objArray5 = new object[2];
                        num8 = num5 + 1;
                        objArray5[0] = num8;
                        num7 = 2;
                        objArray5[1] = num7;
                        objArray4[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray5, null, null, null));
                        objArray3 = objArray4;
                        copyBack = new bool[] { true, true };
                        if (copyBack[0])
                        {
                            NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num5, num9, RuntimeHelpers.GetObjectValue(objArray3[0]) }, null, null, true, false);
                        }
                        if (copyBack[1])
                        {
                            NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num8, num7, RuntimeHelpers.GetObjectValue(objArray3[1]) }, null, null, true, false);
                        }
                        NewLateBinding.LateCall(NewLateBinding.LateGet(MiHoja, null, "Range", objArray3, null, null, copyBack), null, "Merge", new object[0], null, null, null, true);
                        if (table4 != null)
                        {
                            if (table4.Rows.Count > 1)
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 2, 1 }, null, null, null), null, "Value", new object[] { table4.Rows[0][0].ToString() + " " + table4.Rows[0][1].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 2, 2 }, null, null, null), null, "Value", new object[] { table4.Rows[0][2].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 1 }, null, null, null), null, "Value", new object[] { table4.Rows[1][0].ToString() + " " + table4.Rows[1][1].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 2 }, null, null, null), null, "Value", new object[] { table4.Rows[1][2].ToString() }, null, null, false, true);
                            }
                            else if (table4.Rows.Count > 0)
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 2, 1 }, null, null, null), null, "Value", new object[] { table4.Rows[0][0].ToString() + " " + table4.Rows[0][1].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 2, 2 }, null, null, null), null, "Value", new object[] { table4.Rows[0][2].ToString() }, null, null, false, true);
                            }
                        }
                        if ((table3 != null) && (table3.Rows.Count == 1))
                        {
                            if (table3.Rows[0][0].ToString() != "")
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 1, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][0].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][1].ToString() }, null, null, false, true);
                            }
                            else if (table3.Rows[0][2].ToString() != "")
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 1, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][2].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][3].ToString() }, null, null, false, true);
                            }
                            else if (table3.Rows[0][4].ToString() != "")
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 1, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][4].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][5].ToString() }, null, null, false, true);
                            }
                            else if (table3.Rows[0][6].ToString() != "")
                            {
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 1, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][6].ToString() }, null, null, false, true);
                                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { num5 + 3, 3 }, null, null, null), null, "Value", new object[] { table3.Rows[0][7].ToString() }, null, null, false, true);
                            }
                        }
                        objArray4 = new object[2];
                        miHoja = MiHoja;
                        objArray7 = new object[2];
                        objArray7[0] = num5;
                        num9 = 1;
                        objArray7[1] = num9;
                        objArray6 = objArray7;
                        flagArray2 = new bool[] { true, false };
                        if (flagArray2[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray6[0]), typeof(int));
                        }
                        objArray4[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray6, null, null, flagArray2));
                        obj2 = MiHoja;
                        objArray5 = new object[2];
                        num8 = num5 + 3;
                        objArray5[0] = num8;
                        num7 = 3;
                        objArray5[1] = num7;
                        objArray4[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray5, null, null, null));
                        objArray3 = objArray4;
                        copyBack = new bool[] { true, true };
                        if (copyBack[0])
                        {
                            NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num5, num9, RuntimeHelpers.GetObjectValue(objArray3[0]) }, null, null, true, false);
                        }
                        if (copyBack[1])
                        {
                            NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num8, num7, RuntimeHelpers.GetObjectValue(objArray3[1]) }, null, null, true, false);
                        }
                        NewLateBinding.LateSetComplex(NewLateBinding.LateGet(NewLateBinding.LateGet(MiHoja, null, "Range", objArray3, null, null, copyBack), null, "Font", new object[0], null, null, null), null, "Size", new object[] { 12 }, null, null, false, true);
                        objArray4 = new object[2];
                        miHoja = MiHoja;
                        objArray8 = new object[2];
                        objArray8[0] = num5;
                        num9 = 1;
                        objArray8[1] = num9;
                        objArray7 = objArray8;
                        flagArray2 = new bool[] { true, false };
                        if (flagArray2[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray7[0]), typeof(int));
                        }
                        objArray4[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray7, null, null, flagArray2));
                        obj2 = MiHoja;
                        objArray6 = new object[2];
                        objArray6[0] = num5;
                        num8 = 1;
                        objArray6[1] = num8;
                        objArray5 = objArray6;
                        copyBack = new bool[] { true, false };
                        if (copyBack[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray5[0]), typeof(int));
                        }
                        objArray4[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray5, null, null, copyBack));
                        objArray3 = objArray4;
                        flagArray3 = new bool[] { true, true };
                        if (flagArray3[0])
                        {
                            NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num5, num9, RuntimeHelpers.GetObjectValue(objArray3[0]) }, null, null, true, false);
                        }
                        if (flagArray3[1])
                        {
                            NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num5, num8, RuntimeHelpers.GetObjectValue(objArray3[1]) }, null, null, true, false);
                        }
                        NewLateBinding.LateSetComplex(NewLateBinding.LateGet(NewLateBinding.LateGet(MiHoja, null, "Range", objArray3, null, null, flagArray3), null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                        objArray5 = new object[2];
                        miHoja = MiHoja;
                        objArray9 = new object[2];
                        objArray9[0] = num5;
                        num9 = 1;
                        objArray9[1] = num9;
                        objArray8 = objArray9;
                        flagArray3 = new bool[] { true, false };
                        if (flagArray3[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray8[0]), typeof(int));
                        }
                        objArray5[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray8, null, null, flagArray3));
                        obj2 = MiHoja;
                        objArray7 = new object[2];
                        objArray7[0] = num5;
                        num8 = 1;
                        objArray7[1] = num8;
                        objArray6 = objArray7;
                        flagArray2 = new bool[] { true, false };
                        if (flagArray2[0])
                        {
                            num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray6[0]), typeof(int));
                        }
                        objArray5[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray6, null, null, flagArray2));
                        objArray4 = objArray5;
                        copyBack = new bool[] { true, true };
                        if (copyBack[0])
                        {
                            NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num5, num9, RuntimeHelpers.GetObjectValue(objArray4[0]) }, null, null, true, false);
                        }
                        if (copyBack[1])
                        {
                            NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num5, num8, RuntimeHelpers.GetObjectValue(objArray4[1]) }, null, null, true, false);
                        }
                        NewLateBinding.LateSetComplex(NewLateBinding.LateGet(NewLateBinding.LateGet(MiHoja, null, "Range", objArray4, null, null, copyBack), null, "Font", new object[0], null, null, null), null, "Size", new object[] { 14 }, null, null, false, true);
                        num5 += 5;
                    }
                }
                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { 1, 1 }, null, null, null), null, "ColumnWidth", new object[] { 60 }, null, null, false, true);
                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { 1, 2 }, null, null, null), null, "ColumnWidth", new object[] { 0x23 }, null, null, false, true);
                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Cells", new object[] { 1, 3 }, null, null, null), null, "ColumnWidth", new object[] { 30 }, null, null, false, true);
                objArray6 = new object[2];
                miHoja = MiHoja;
                objArray9 = new object[2];
                num9 = 1;
                objArray9[0] = num9;
                num8 = 1;
                objArray9[1] = num8;
                objArray6[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray9, null, null, null));
                obj2 = MiHoja;
                objArray8 = new object[2];
                objArray8[0] = num5;
                num7 = 3;
                objArray8[1] = num7;
                objArray7 = objArray8;
                flagArray3 = new bool[] { true, false };
                if (flagArray3[0])
                {
                    num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray7[0]), typeof(int));
                }
                objArray6[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray7, null, null, flagArray3));
                objArray5 = objArray6;
                flagArray2 = new bool[] { true, true };
                if (flagArray2[0])
                {
                    NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num9, num8, RuntimeHelpers.GetObjectValue(objArray5[0]) }, null, null, true, false);
                }
                if (flagArray2[1])
                {
                    NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num5, num7, RuntimeHelpers.GetObjectValue(objArray5[1]) }, null, null, true, false);
                }
                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Range", objArray5, null, null, flagArray2), null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                objArray6 = new object[2];
                miHoja = MiHoja;
                objArray9 = new object[2];
                num9 = 1;
                objArray9[0] = num9;
                num8 = 1;
                objArray9[1] = num8;
                objArray6[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(miHoja, null, "Cells", objArray9, null, null, null));
                obj2 = MiHoja;
                objArray8 = new object[2];
                objArray8[0] = num5;
                num7 = 3;
                objArray8[1] = num7;
                objArray7 = objArray8;
                flagArray3 = new bool[] { true, false };
                if (flagArray3[0])
                {
                    num5 = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray7[0]), typeof(int));
                }
                objArray6[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj2, null, "Cells", objArray7, null, null, flagArray3));
                objArray5 = objArray6;
                flagArray2 = new bool[] { true, true };
                if (flagArray2[0])
                {
                    NewLateBinding.LateSetComplex(miHoja, null, "Cells", new object[] { num9, num8, RuntimeHelpers.GetObjectValue(objArray5[0]) }, null, null, true, false);
                }
                if (flagArray2[1])
                {
                    NewLateBinding.LateSetComplex(obj2, null, "Cells", new object[] { num5, num7, RuntimeHelpers.GetObjectValue(objArray5[1]) }, null, null, true, false);
                }
                NewLateBinding.LateSetComplex(NewLateBinding.LateGet(MiHoja, null, "Range", objArray5, null, null, flagArray2), null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                NewLateBinding.LateCall(MiLibro, null, "Close", new object[] { true }, null, null, null, true);
                NewLateBinding.LateCall(MiAplicacion, null, "Quit", new object[0], null, null, null, true);
                MiHoja = null;
                MiLibro = null;
                MiAplicacion = null;
                GC.Collect();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }
    }
}

